package com.maimao.auth.client;

import com.maimao.auth.client.fallback.CompanyFallBackFactory;
import com.maimao.auth.client.fallback.UserFallBackFactory;
import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.user.sys.vo.Permissions;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author MaoLin Wang
 * @date 2020/11/30 9:45 下午
 */
@FeignClient(contextId = "companyClient", value = ServiceContainer.USER_SERVICE, fallbackFactory = CompanyFallBackFactory.class, configuration = FeignInterceptor.class)
@RequestMapping("/web/company")
public interface CompanyClient {
    /**
     * 根据邮箱查询企业权限
     */
    @GetMapping("/permissions-g/email")
    Result<Permissions> getCompanyPermissionByEmail(@RequestParam("email") String email);
}
